package com.xqb.modules.service.impl;

import com.xqb.common.utils.DateUtils;
import com.xqb.modules.domain.po.LesInterests;
import com.xqb.modules.mapper.LesInterestsMapper;
import com.xqb.modules.service.ILesInterestsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户兴趣Service业务层处理
 * 
 * @author xqb
 * @date 2024-10-14
 */
@Service
public class LesInterestsServiceImpl implements ILesInterestsService 
{
    @Autowired
    private LesInterestsMapper lesInterestsMapper;

    /**
     * 查询用户兴趣
     * 
     * @param id 用户兴趣主键
     * @return 用户兴趣
     */
    @Override
    public LesInterests selectLesInterestsById(Long id)
    {
        return lesInterestsMapper.selectLesInterestsById(id);
    }

    /**
     * 查询用户兴趣列表
     * 
     * @param lesInterests 用户兴趣
     * @return 用户兴趣
     */
    @Override
    public List<LesInterests> selectLesInterestsList(LesInterests lesInterests)
    {
        return lesInterestsMapper.selectLesInterestsList(lesInterests);
    }

    /**
     * 新增用户兴趣
     * 
     * @param lesInterests 用户兴趣
     * @return 结果
     */
    @Override
    public int insertLesInterests(LesInterests lesInterests)
    {
        lesInterests.setCreateTime(DateUtils.getNowDate());
        return lesInterestsMapper.insertLesInterests(lesInterests);
    }

    /**
     * 修改用户兴趣
     * 
     * @param lesInterests 用户兴趣
     * @return 结果
     */
    @Override
    public int updateLesInterests(LesInterests lesInterests)
    {
        lesInterests.setUpdateTime(DateUtils.getNowDate());
        return lesInterestsMapper.updateLesInterests(lesInterests);
    }

    /**
     * 批量删除用户兴趣
     * 
     * @param ids 需要删除的用户兴趣主键
     * @return 结果
     */
    @Override
    public int deleteLesInterestsByIds(Long[] ids)
    {
        return lesInterestsMapper.deleteLesInterestsByIds(ids);
    }

    /**
     * 删除用户兴趣信息
     * 
     * @param id 用户兴趣主键
     * @return 结果
     */
    @Override
    public int deleteLesInterestsById(Long id)
    {
        return lesInterestsMapper.deleteLesInterestsById(id);
    }
}
